﻿Partial Class Cwgl_CancelExportPz
    Inherits Mysoft.Map.Application.Security.AppPage

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        If Not IsPostBack Then

            If Request.Form("txtBldGUIDList") <> Nothing AndAlso Request.Form("txtBldGUIDList").Trim() <> "" Then

                If Request.QueryString("CwztGuid") <> Nothing AndAlso Request.QueryString("CwztGuid").ToString() <> "" AndAlso Session("BUGUID") <> Nothing AndAlso Session("BUGUID").ToString() <> "" Then
                    Dim strCwjkGuid As String = Request.QueryString("CwztGuid").ToString()
                    Dim strBUGuid As String = Session("BUGUID").ToString()
                    Dim strFilter As String = Request.Form("txtBldGUIDList").Trim()
                    Dim strCustomFilter As String = Mysoft.Map.Utility.General.XML2Filter(strFilter)

                    If strCustomFilter <> "1=2" Then
                        appGrid.CustomFilter = " PZGUID IN (select pzguid from p_CwjkPzVoucher b where b.voucherguid in (select VouchGUID from vs_cwjkvoucher " _
                                     & " where vouchstatus<>'作废' and VouchGUID in (select VoucherGUID from p_CwjkPzVoucher) and BUGUID='" & strBUGuid & "' and " & strCustomFilter & ") )"
                    Else
                        appGrid.CustomFilter = " PZGUID IN (select pzguid from p_CwjkPzVoucher b where b.voucherguid in (select VouchGUID from vs_cwjkvoucher " _
                                     & " where vouchstatus<>'作废' and VouchGUID in (select VoucherGUID from p_CwjkPzVoucher) and BUGUID='" & strBUGuid & "') )"
                    End If
                    txtGUIDs.Text = ""
                Else
                    appGrid.CustomFilter = " PZGUID IN (select pzguid from p_CwjkPzVoucher b where b.voucherguid in (" & Request.Form("txtBldGUIDList").Trim() & ")) and voucherguid not in (" & Request.Form("txtBldGUIDList").Trim() & ")"
                    txtGUIDs.Text = Request.Form("txtBldGUIDList").Trim()
                End If

            Else
                txtGUIDs.Text = ""
                appGrid.CustomFilter = "1=2"
            End If

        End If

    End Sub

End Class
